﻿using System.Runtime.Serialization;
using System.Windows.Media;

namespace TetriBricks
{
    [DataContract]
    internal class Brick
    {
        public Brick()
        {
        }

        public Brick(int row, int column, Color color)
        {
            Row = row;
            Column = column;
            Color = color;
        }


        [DataMember]
        public int Row { get; set; }

        [DataMember]
        public int Column { get; set; }

        //public Color Color
        //{
        //    get { return (Color)  ColorConverter.ConvertFromString(_colorString); }
        //    set { _colorString = value.ToString(); }
        //}

        [DataMember]
        public Color Color { get; set; }


        //public static bool operator ==(Brick a, Brick b)
        //{
        //    return (a.Color == b.Color) && (a.Row == b.Row ) && (a.Column == b.Column);
        //}

        //public static bool operator !=(Brick a, Brick b)
        //{
        //    return !(a == b);
        //}

        //public override int GetHashCode()
        //{
        //    return this.Column * this.Row ;
        //}

        //public override bool Equals(object obj)
        //{
        //    if (obj is Brick)
        //    {
        //        Brick b = (Brick)obj;
        //        return (this.Color == b.Color) && (this.Row == b.Row) && (this.Column == b.Column);
        //    }
        //    else
        //        return false;
        //}
    }
}